package com.example.r2022913.service.WxService.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.r2022913.model.dao.WxDao.DepartmentDao;
import com.example.r2022913.model.entity.WxEntity.DepartmentEntity;
import com.example.r2022913.service.WxService.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentDao, DepartmentEntity> implements DepartmentService {
    @Autowired
    DepartmentDao departmentDao;

    @Override
    public IPage departmentList(Integer pageNum, Integer pageSize, Map<String, Object> params) {
        Page pageWc = new Page(pageNum,pageSize);
        IPage<DepartmentEntity> page=this.page(pageWc,null);
        return page;
    }

    @Override
    public Integer departmentCount() {
        return departmentDao.selectCount(null);
    }

    @Override
    public DepartmentEntity departmentById(Long departmentId) {
        return departmentDao.selectById(departmentId);
    }
}
